Stop AI-generated titles overwriting user-renamed session names#46
Merged
Merged
Conversation
PR doctly#42 (b88b19f) wired ai-title entries into the customTitle field returned by readSessionFile via `customTitle: customTitle || aiTitle`. session-cache.js then calls setName(sessionId, customTitle) on every index pass, which writes to session_meta.name — the same column that stores user renames done via the Switchboard UI (rename-session in main.js). So every re-index of a file that contains an ai-title entry clobbers the user's manual rename. The PR description claimed "User-set customTitle still takes precedence", but that only holds for JSONL custom-title entries (Claude `/title`), not for in-app UI renames. Fix: separate the two title sources end-to-end. - read-session-file.js now returns customTitle and aiTitle as separate fields. - session_cache table gains an aiTitle column; v3 migration adds the column and clears the cache so a fresh index repopulates it. - session-cache.js carries aiTitle through to the API output. setName is now only ever called with a JSONL customTitle — ai-title never touches the DB. - Sidebar/grid/dialog/jsonl-viewer display priority is now: user rename (session.name) > AI title (session.aiTitle) > raw first prompt. doctly#33's original intent (AI titles displayed in the sidebar instead of raw prompts) is preserved through session.aiTitle, but the DB session_meta.name column reverts to being user-only — manual renames are now durable. Note: pre-fix DB pollution (existing rows where ai-title was already written into session_meta.name) is not auto-cleaned — those sessions will keep their AI-title-as-name until renamed manually.
aaaronmiller
added a commit
to aaaronmiller/switchboard
that referenced
this pull request
May 30, 2026
Merge upstream changes from doctly/switchboard including: - v0.0.27: WebGL terminal renderer - v0.0.28: CI republish fixes - v0.0.29: Sidebar duplicate fix, cursor blink reduction - v0.0.30: Merge duplicate project groups, AI title support - doctly#46: Stop AI titles overwriting user renames Conflicts resolved: - build.yml: Rewrote with proper release creation - package.json: Keep fork version (0.0.34), upstream deps merged - package-lock.json: Regenerated
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
Test plan
Limitations
Fixes regression introduced by #42 / #33.